#include "Branch1BaseConfig.h"
#include "TriggerEventHandler.h"
#include <daisy/EventSystem.h>
using namespace DAISY;

TriggerEventHandler::TriggerEventHandler(void)
	:_callback(NULL)
{}
void TriggerEventHandler::stop(void)
{
	EventManager * manager = getEventManager();
	if(manager)
	{
		manager->goOut(shared_from_this());
	}
}

void TriggerEventHandler::doExecute(Event * evt)
{
	if(isEnable())
	{
		assert(evt);
		_callback->execute(evt);
	}
}
void TriggerEventHandler::setCallback(TriggerEventHandlerCallback * callback)
{
	_callback = callback;
}